import { GaRegExp, ruleInject, ruleInjectable } from "../InjectionRule";
import { blankRemove } from "../methods/blank-remove";

@ruleInjectable()
export default class typeCreatedRule extends GaRegExp {

	@ruleInject() private variableNameRule!: GaRegExp;

	@ruleInject() private genericRule!: GaRegExp;

	@ruleInject() private typeCalcRule!: GaRegExp;

	public RuleInit() {
		this.ParseRule([
			"type", "\\s", blankRemove,
			this.Supply("TYPE_CREATED"),
			"(", this.variableNameRule, ")", blankRemove,
			this.genericRule,
			"(!=)", blankRemove,
			"(", this.typeCalcRule, ")",
		]);
	}

}
